package Libs.Utils.Strings
{
	public const Insert:Function = function( source:String, index:int, value:String ):String
    {
        var strA:String = "";
        var strB:String = "";
        
        if( index == 0 )
        {
            return value + source ;
        }
        else if( index == source.length )
        {
            return source + value ;
        }
        
        /* TODO:
        review the logic when startIndex == -1
         */
        strA = source.substr( 0, index );
        strB = source.substr( index );
        
        return strA + value + strB;
    };
}